package net.lzzy.gsonandjson;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;
import java.util.List;

public class SaveAsTextFileTestHdfs {

    public static void main(String[] args) {
        SparkConf sparkConf = new SparkConf().setAppName("SaveAsTextFileTest").setMaster("local");
        JavaSparkContext javaSparkContext = new JavaSparkContext(sparkConf);
        JavaRDD<String> stringJavaRDD1 = javaSparkContext.textFile("src/records30.txt");
        JavaRDD<String> stringJavaRDD2 = javaSparkContext.textFile("src/owner30.txt");
        JavaRDD<String> stringJavaRDD3 = javaSparkContext.textFile("src/violation.txt");
        stringJavaRDD1.saveAsTextFile("hdfs://192.168.17.3:9000/records30");
        stringJavaRDD2.saveAsTextFile("hdfs://192.168.17.3:9000/owner30");
        stringJavaRDD3.saveAsTextFile("hdfs://192.168.17.3:9000/violation");

    }
}
